package com.hm.rabitmq.service;

import org.springframework.amqp.core.AmqpTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * @author shishun.wang
 * @date 2016年12月13日 下午5:29:45
 * @version 1.0
 * @describe
 */
@Component
public class Sender {

	@Autowired
	private AmqpTemplate rabbitTemplate;

//	public void send() {
//		for (int i = 0; i < 100; i++) {
//			this.rabbitTemplate.convertAndSend("hello", "TASK_" + i);
//		}
//	}

//	public void helloRpc() {
//		for (int i = 0; i < 100; i++) {
//			Object receive = this.rabbitTemplate.convertSendAndReceive("hello_rpc", "HELLO_" + i);
//			System.out.println(receive);
//		}
//	}
}
